<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib uri="/struts-tags" prefix="s" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
	 <style type="text/css">
	    .login{width:700px;border:1px solid #ccc;display:none;position:absolute;left:40px;top:50px;z-index:100;background-color: white;}
		.tab_login{width:700px;left:40px}
		.tab_login td{height:50px;line-height:50px;}
	 </style>
    <base href="<%=basePath%>">
    
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	 <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="UI/admins/css/main.css"/>
    <script type="text/javascript" src="UI/admins/js/libs/modernizr.min.js"></script>
	
    <script type="text/javascript" src="UI/admins/js/libs/jquery.js"></script>
  </head>
  
  <body>
<s:if test="null==#session.account">
	<s:a href="login.action" align="center"><h2>您不能直接访问网站内部页面,请先登录!</h2></s:a>
</s:if>
<s:else>
	<s:if test="message!=null">
		
		<script type="text/javascript">
		$(function(){
			$(".login").show();
			});
		</script>
	</s:if>
    <!--/sidebar-->

        <div class="crumb-wrap">

            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">作品管理</a><span class="crumb-step">&gt;</span><span>订单详情</span></div>
        </div>
        <div class="result-wrap">
            <div class="result-content">
            	<s:form action="cancelOrder" method="post">
            	<s:hidden name="ordertable.id"></s:hidden>
                    <table class="insert-tab" width="100%">
                        <tbody>
                        	<tr>
                            	
                                <th width="150"><i class="require-red">*</i>订单号：</th>
                                <td>
                                	<s:textfield name="ordertable.orderId" class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                            	
                                <th ><i class="require-red">*</i>客户：</th>
                                <td>
                                	<s:textfield name="username" class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>

                            <tr>
                                <th><i class="require-red">*</i>收货人电话：</th>
                                <td>
                                	<s:textfield name="ordertable.receiverPhone"  class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>收货人姓名：</th>
                                <td>
                                	<s:textfield name="ordertable.receiverPhone"  class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>收货人电话：</th>
                                <td>
                                	<s:textfield name="ordertable.receiverPhone"  class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>商品：</th>
                                <td>
                                	<s:textfield name="goodsname" class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            
                            <tr>
                                <th><i class="require-red">*</i>派送员：</th>
                                <td>
                                	<s:textfield name="ordertable.disparter.name" class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>配送机器的地址：</th>
                                <td>
                                	<s:textfield name="ordertable.machine.machineaddress.machineaddress.name" class="common-text required" disabled="true"></s:textfield>
									<s:textfield name="ordertable.machine.machineaddress.name" class="common-text required" disabled="true"></s:textfield>
                                </td>
                            </tr>
                            <tr>
                                <th><i class="require-red">*</i>是否需要加热：</th>
                                <td>
                                	<s:if test="ordertable.heat==1">
                                		需要加热
                                	</s:if>
                                	<s:elseif test="ordertable.heat==0">
                                		无需加热
                                	</s:elseif>
                                </td>
                            </tr>
                            <tr>
                                <th></th>
                                <td>
									<a class="btn btn-primary btn6 mr10" href="getImage?orderId=<s:property value="ordertable.orderId"/>">打印二维码</a>
                                    <input class="btn btn-primary btn6 mr10" value="订单作废" type="submit">
                                    <input class="btn btn6" onclick="history.go(-1)" value="返回" type="button">
                                </td>
                            </tr>
                        </tbody></table>
                </s:form>
            </div>
        </div>
</s:else>
	<!--/main-->
  	<script type="text/javascript" language="javascript">
$(document).ready(function(){
	//获取用户
	$.post("getUser.action",function(data){      //data代表服务器端传来的数据
		var jsonObj=eval("("+data+")");                    //封装服务器数据为json对象
		for(var i=0;i<jsonObj.length;i++){
			var $option=$("<option></option>");
			$option.attr("value",jsonObj[i].uid);
			$option.text(jsonObj[i].name);
			$("#userId").append($option);
		}
	});
	//根据用户获取货物
	$("#userId").change(function(){
		$.post("getGoods.action",{uid:$("#userId").val()},function(data){
			//清空货物
			$("#goodsId option[value!='']").remove();
			var jsonObj=eval("("+data+")");
			for(var i=0;i<jsonObj.length;i++){
				var $option=$("<option></option>");
				$option.attr("value",jsonObj[i].gid);
				$option.text(jsonObj[i].gname);
				$("#goodsId").append($option);
			}
		});
	});
	//获取一级地址
	$.post("getMachineAddressFirst.action",function(data){      //data代表服务器端传来的数据
		var jsonObj=eval("("+data+")");                    //封装服务器数据为json对象
		for(var i=0;i<jsonObj.length;i++){
			var $option=$("<option></option>");
			$option.attr("value",jsonObj[i].mid);
			$option.text(jsonObj[i].mname);
			$("#address1").append($option);
		}
	});
	//获取二级地址
	$("#address1").change(function(){
		$.post("getMachineAddressSecond.action",{mid:$("#address1").val()},function(data){
			//清空二级地址
			$("#address2 option[value!='']").remove();
			var jsonObj=eval("("+data+")");
			for(var i=0;i<jsonObj.length;i++){
				var $option=$("<option></option>");
				$option.attr("value",jsonObj[i].mid);
				$option.text(jsonObj[i].mname);
				$("#address2").append($option);
			}
		});
	});
	 $(function(){
		     $("#showLogin").click(function(){
			   $(".login").show();
			 });
		  });
});
</script> 
  </body>
</html>
